package compiler.scanner;

import java.util.HashMap;

public class SetOfSymbols
    extends HashMap<Character, TokenId>
{
    public SetOfSymbols()
    {
        put('!', TokenId.EXCLAMATION);
        put('<', TokenId.LESS);
        put('=', TokenId.ASSIGN);
        put('+', TokenId.PLUS);
        put('-', TokenId.MINUS);
        put('*', TokenId.MUL);
        put('%', TokenId.MOD);
        put('[', TokenId.LEFT_SQUARE_BRACKET);
        put(']', TokenId.RIGHT_SQUARE_BRACKET);
        put('(', TokenId.LEFT_ROUND_BRACKET);
        put(')', TokenId.RIGHT_ROUND_BRACKET);
        put('{', TokenId.LEFT_BRACE);
        put('}', TokenId.RIGHT_BRACE);
        put(';', TokenId.SEMICOLON);
        put(',', TokenId.COMMA);
        put('.', TokenId.DOT);
    }

    public Character GetSymbol(TokenId tokenId)
    {
        Character symbol = null;
        for (Character ch : keySet())
        {
            if (get(ch) == tokenId)
            {
                symbol = ch;
                break;
            }
        }
        return symbol;
    }
}
